package com.xy.generate.cli.command.children;

import cn.hutool.core.util.ReflectUtil;
import com.xy.generate.config.MainTemplateConfig;
import lombok.extern.slf4j.Slf4j;
import picocli.CommandLine;

import java.lang.reflect.Field;
import java.util.Arrays;

@Slf4j
@CommandLine.Command(name = "config", description = "配置", mixinStandardHelpOptions = true)
public class ConfigCommand implements Runnable {
    @Override
    public void run() {
        log.info("参数信息:");
        //反射拿到所有字段
        Field[] fields = ReflectUtil.getFields(MainTemplateConfig.class);
        for (Field field : fields) {
            System.out.println("字段名称:" + field.getName());
            System.out.println("字段类型:" + field.getType());
            System.out.println("--------");
        }
    }
}
